# Copyright 2009 Autodesk, Inc. All rights reserved. # Use of this software is subject to the terms of the Autodesk license agreement # provided at the time of installation or download, or which otherwise accompanies # this software in either electronic or hard copy form. # # Script description: # Shows how the copy module can be use to duplicate some MotionBuilder objects. # Internally, each type that has a Clone method exposed can be used with __copy__ # from pyfbsdk import * import copy sys = FBSystem() scene = sys.Scene # Test built in __copy__ method that dispatches on Clone # Model m = FBModelCube("Cube") m.Show = True m2 = copy.copy(m) # character if len(scene.Characters): c = scene.Characters[0] c2 = copy.copy(c) # constraint if len(scene.Constraints): constraint = scene.Constraints[0] constraint2 = copy.copy(constraint) # Material if len(scene.Materials): mat = scene.Materials[0] mat2 = copy.copy(mat) # texture if len(scene.Textures): t = scene.Textures[0] t2 = copy.copy(t)